#!/usr/bin/python3
import sys

rna_pass = {'11': 'A', '12': 'B', '13': 'C', '14': 'D', '15': 'E',
    '21': 'F', '22': 'G', '23': 'H', '24': 'I', '25': 'K',
    '31': 'L', '32': 'M', '33': 'N', '34': 'O', '35': 'P',
    '41': 'Q', '42': 'R', '43': 'S', '44': 'T', '45': 'U',
    '51': 'V', '52': 'W', '53': 'X', '54': 'Y', '55': 'Z'}
try:
    n = int(input())
    if n < 1 or n > 100:
        sys.exit(0)
    for x in range(n):
        a_str = [item for item in input().split()]
        m = int(a_str[0])
        a_str.pop(0)
        r = ""
        for i in range(len(a_str)):
            r = r + rna_pass[a_str[i]]

        print("Case #%d: %s" % (x + 1, r))

except ValueError:
    pass
except EOFError:
    pass
except MemoryError:
    pass
